package com.rr.config;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liyong$@skieer.com
 * @qualifiedClassName com.yuntingai.cem.properties
 * @date 2023-06-14 11:17
 */
@Configuration
public class MyRedisProperties {

    @Bean
    @ConfigurationProperties(prefix = "spring.redis")
    public RedisDataSource redisPrimary(){
       return new RedisDataSource();
    }

    @Bean
    @ConfigurationProperties(prefix = "spring.redis-second")
    public RedisDataSource redisSecond(){
        return new RedisDataSource();
    }

    @Data
    public static class RedisDataSource{
        String port;
        String host;
        @JsonIgnore
        String password;
    }

}
